import React from 'react'
import ReactDOM from 'react-dom'
import { Link } from 'react-router-dom'
import _ from 'lodash'
import {fetchJson} from '../../utils/fetch'

class Home extends React.Component{
    constructor(props){
        super(props);
        this.state = {
            data: ['red', 'green', 'blue']
        }
    }

    componentDidMount() {
        // console.log(this.props.history)
        this.fetchData();
    }

    fetchData(){
        fetchJson({
            type: "POST",
            url: "http://39.108.10.121:3000/api/getmovie",
            success: (res) => {
                console.log(res)
            },
            error: (err) => {

            }
        })
    }

    handleChange(){}

    render(){
        const {data} = this.state;
        return(
            <div>
                <div><Link to='/about'>about me</Link></div>
                <input type="tel" pattern="[0-9]*" />
            </div>
        )
    }
}

export default Home
